package com.hangxin.log.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hangxin.common.utils.StringUtils;
import com.hangxin.log.domain.DocumentComparisonLog;
import com.hangxin.log.mapper.DocumentComparisonLogMapper;
import com.hangxin.log.service.IDocumentComparisonLogService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DocumentComparisonLogImpl extends ServiceImpl<DocumentComparisonLogMapper, DocumentComparisonLog> implements IDocumentComparisonLogService {
    @Override
    public List<DocumentComparisonLog> queryList(DocumentComparisonLog documentComparisonLog) {
        QueryWrapper<DocumentComparisonLog> queryWrapper = Wrappers.query();
        if (StringUtils.isNotEmpty(documentComparisonLog.getSourceFileName())) {
            queryWrapper.eq("source_file_name", documentComparisonLog.getSourceFileName());
        }
        return this.list(queryWrapper);
    }
}
